Skip to content

Allow explicitly specifying entryId when multiple entries exist#404

Open
adonig wants to merge 1 commit intomaster-co:rcfrom
adonig:rc
Open

Allow explicitly specifying entryId when multiple entries exist#404
adonig wants to merge 1 commit intomaster-co:rcfrom
adonig:rc

Conversation

@adonig
Copy link
Copy Markdown

@adonig adonig commented Jun 26, 2025

Problem

In Vite projects where both src/main.tsx (used for vite serve) and src/index.ts (used for vite build) exist, the MasterCSS Vite plugin currently always picks src/index.ts as the entry due to glob ordering (alphabetical by default).

Solution

This PR introduces a new entryId option for the masterCSS() plugin. It allows users to explicitly define the desired entry point:

masterCSS({
  entryId: process.env.NODE_ENV === 'production' 
    ? 'src/index.ts' 
    : 'src/main.tsx',
})

Usage

No breaking changes. If entryId is not provided, the plugin behavior remains unchanged.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants